
/* GCSx
** GAME.H
**
** Game playing module- basic init, other top-level functionality
*/

/*****************************************************************************
** Copyright (C) 2003-2006 Janson
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
** 
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
*****************************************************************************/

#ifndef __GCSx_GAME_H_
#define __GCSx_GAME_H_

// Load a game; if successful, can start calling game loop
// Initializes GL, all parts of game, etc.
void gcsxGameplay(const std::string& gameFile) throw_File;

// Close game; safe to call with no game running
// Will exit GL if necessary
void gcsxEndgame();

// Game loop- self-regulates fps/time cycles
// Don't call if no game loaded!
// Uses SDL events/input
// Returns values as follows-
enum {
    GAME_EXIT = 1,
    GAME_MENU,
    GAME_CONSOLE,
};
int gcsxGameloop();

// Game loop- same thing but as part of GUI
// a) handles display slightly different
// b) sends events to desktop instead of returning values
// c) only recieves keyboard, mouse, quit, active events
// d) should NOT look at events or keyboard/input unless keysOk
// @TODO: discrepancy in above function receives resize events
// and this one will have them go through the desktop
void gcsxGameloopGui(int keysOk);

#endif

